package com.zthz.douxing.sendmessageservice.service

import com.zthz.douxing.TaskInfo
import com.zthz.douxing.event.UserWillDepartEvent

abstract class AbstractSendMessageService extends AbstractHandlerService{


    @Override
    protected String hanldTask(TaskInfo taskInfo) {

        String hanldResult = null
        try{
            UserWillDepartEvent userWillDepartEvent = formateTask2UserWillDepartEvent(taskInfo)
            hanldResult = sendMessage(userWillDepartEvent)
        }catch (Exception e){
            throw e
        }
        return hanldResult
    }

    protected abstract String sendMessage(UserWillDepartEvent userWillDepartEvent)throws Exception
}
